package com.glsc.ngateway.common.api.shortmsg.bo;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Builder
@AllArgsConstructor
@NoArgsConstructor
@Data
@ApiModel("发送群机器⼈消息")
public class WebhookGenericVo  implements Serializable {
    @ApiModelProperty("群机器⼈webhook地址")
    @NotNull
    private String webhookUrl;
    @ApiModelProperty("消息类型")
    @NotNull
    private String msgType;
    @ApiModelProperty("提醒群成员的oa账号列表，仅在文本类型有效")
    private List<String> mentionedOaAccounts;
    @Builder.Default
    @ApiModelProperty("消息内容与参数")
    private Map<String, Object> additionalProperties = new HashMap<>();
    @JsonAnySetter
    public void addAdditionalProperty(String key, Object value) {
        this.additionalProperties.put(key, value);
    }
    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return additionalProperties;
    }
}